package com.repair.user.pojo.entity.convetor;

import com.repair.api.user.response.data.UserInfo;
import com.repair.user.pojo.entity.User;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface UserConverter {

    UserConverter INSTANCE = Mappers.getMapper(UserConverter.class);


    /**
     * mapper 转为 list
     * @param userList
     * @return
     */
    List<UserInfo> mapToVOList(List<User> userList);

    /**
     * vo 转为实体
     * @param userInfo vo类
     * @return
     */
    User mapToEntity(UserInfo userInfo);
}
